package usermodel

type UserNameInfo struct {
	ID   int    `validate:"omitempty"` // ID
	Name string `validate:"required"`  // 用户名
}

type User struct {
	UserNameInfo
	Password    string `validate:"required"`                  // 用户密码
	Phone       string `validate:"required"`                  // 手机号
	Invitation  string `validate:"required"`                  // 激活码
	Email       string `validate:"required,email"`            // 邮箱信息
	DeviceInfo  string `db:"device_info" validate:"required"` // 设备信息
	Certificate string `validate:"-"`                         // 证书
	Pubkey      string `validate:"required"`                  // 公钥
	Signature   []byte `validate:"-"`                         // 签名
	IsRevoked   int    `validate:"omitempty"`                 // 是否被封禁
	UGroupID    int    `db:"ug_id" validate:"omitempty"`
	TimeStamp   string `validate:"required"` // 时间戳
	Token       string `validate:"-"`
}

type UserLogin struct {
	Name        string `validate:"required" ` // 用户名
	Password    string `validate:"required"`  // 密码
	Certificate string `validate:"required"`  // 证书
	Signature   []byte `validate:"required"`  // 签名
}

type UserReset struct {
	Name        string `validate:"required"` // 用户名
	OldPassword string `validate:"required"` // 旧密码
	NewPassword string `validate:"required"` // 新密码
	Certificate string `validate:"required"` // 证书
	Signature   []byte `validate:"required"` // 签名
	TimeStamp   string `validate:"required"` // 时间戳
}

type UserResetByAdmin struct {
	Name        string `validate:"required"` // 用户名
	NewPassword string `validate:"required"` // 新密码
	TimeStamp   string `validate:"required"` // 时间戳
}

type UserName struct {
	Name string `validate:"required"` // 用户名字信息
}

type IdentityIdentifier struct {
	IdentityIdentifier string // 用户标识
}

type TokenRequest struct {
	Version             string `json:"version"`
	Msgid               string `json:"msgid"`
	Systemtime          string `json:"systemtime"`
	Strictcheck         string `json:"strictcheck"`
	Appid               string `json:"appid"`
	Expandparams        string `json:"expandparams"`
	Token               string `json:"token"`
	Sign                string `json:"sign"`
	Encryptionalgorithm string `json:"encryptionalgorithm"`
}

type ResponseData struct {
	InResponseTo string `json:"inresponseto"`
	SystemTime   string `json:"systemtime"`
	ResultCode   string `json:"resultCode"`
	Msisdn       string `json:"msisdn"`
	TaskId       string `json:"taskId"`
}
type Item struct {
	PhoneNumber  string `json:"PhoneNumber"`
	IDCardNumber string `json:"IDCardNumber"`
}

type SimRequest struct {
	ReqData string `json:"reqData"`
	Sign    string `json:"sign"`
}

type ReqData struct {
	PhoneNumber   string `json:"phoneNumber"`
	TemplateId    string `json:"templateId"`
	CallbackUrl   string `json:"callbackUrl"`
	MsgType       string `json:"msgType"`
	TemplateParam string `json:"templateParam"`
	EncVcode      string `json:"encVcode"`
	ExpandParams  string `json:"expandparams"`
}

type SimResponse struct {
	ResultCode  string          `json:"resultCode"`
	Desc        string          `json:"desc"`
	ServiceTime string          `json:"serviceTime"`
	Data        SimResponseData `json:"data"`
}

type SimResponseData struct {
	TaskId       string `json:"taskId"`
	TemplateId   string `json:"templateId"`
	TemplateName string `json:"templateName"`
	MsgText      string `json:"msgText"`
	SimCode      string `json:"simCode"`
}

type SimCallBackRequest struct {
	ResultCode    string          `json:"resultCode"`
	Desc          string          `json:"desc"`
	Data          SimCallBackData `json:"data"`
	Usessionid    string          `json:"usessionid"`
	UidExpireTime string          `json:"uidExpireTime"`
}

type SimCallBackData struct {
	Result        string        `json:"result"`
	ResultDes     string        `json:"resultDes"`
	CallBackType  string        `json:"callBackType"`
	TaskId        string        `json:"taskId"`
	TaskStartTime string        `json:"taskStartTime"`
	Paid          bool          `json:"paid"`
	Vcode         string        `json:"vcode"`
	PhoneSendStat PhoneSendStat `json:"phoneSendStat"`
	Signature     string        `json:"signature"`
}

type PhoneSendStat struct {
	Phone string `json:"phone"`
	State int64  `json:"state"`
}

type SingleLoginRequest struct {
	Version      string `json:"version"`
	Msgid        string `json:"msgid"`
	Minappid     string `json:"minappid"`
	Systemtime   string `json:"systemtime"`
	Expandparams string `json:"expandparams"`
	Token        string `json:"token"`
	Sign         string `json:"sign"`
}

type SingleLoginResponse struct {
	SystemTime  string `json:"systemTime"`
	ResultCode  string `json:"resultCode"`
	PhoneNumber string `json:"phoneNumber"`
}
